<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增退休干部信息')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-cadre-add">
            <input name="deptId" type="hidden" id="treeId"/>
            <h4 class="form-header h4">基本信息</h4>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">姓名：</label>
                        <div class="col-sm-8">
                            <input name="userName" class="form-control" type="text" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <!--<div class="form-group">
                        <label class="col-sm-3 control-label">头像路径：</label>
                        <div class="col-sm-8">
                            <input name="avatar" class="form-control" type="text">
                        </div>
                    </div>-->
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">出生年月：</label>
                        <div class="col-sm-8">
                            <input name="birthday" class="time-input" type="text" placeholder="出身年月">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">籍贯：</label>
                        <div class="col-sm-8">
                            <input name="nativePlace" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">身份：</label>
                        <div class="col-sm-8">
                            <select name="identity" class="form-control m-b" th:with="type=${@dict.getType('old_identity')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">本人联系电话：</label>
                        <div class="col-sm-8">
                            <input name="phonenumber" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">性别：</label>
                        <div class="col-sm-8">
                            <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">学历：</label>
                        <div class="col-sm-8">
                            <input name="education" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">民族：</label>
                        <div class="col-sm-8">
                            <input name="nation" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">编制类型：</label>
                        <div class="col-sm-8">
                            <select name="organizationType" class="form-control m-b" th:with="type=${@dict.getType('old_organization_type')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">政治面貌：</label>
                        <div class="col-sm-8">
                            <input name="politics" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">入党时间：</label>
                        <div class="col-sm-8">
                            <input name="partyTime" class="time-input" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">工作时间：</label>
                        <div class="col-sm-8">
                            <input name="workTime" class="time-input" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">退休时间：</label>
                        <div class="col-sm-8">
                            <input name="retireTime" class="time-input" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">退休时所在单位：</label>
                        <div class="col-sm-8">
                            <input name="retireCompany" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">退休时职务：</label>
                        <div class="col-sm-8">
                            <input name="retireJob" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">退休时职级(参公编制)：</label>
                        <div class="col-sm-8">
                            <input name="retireLevelPublic" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">退休时职级(事业编制)：</label>
                        <div class="col-sm-8">
                            <input name="retireLevelCause" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">专业技术职务：</label>
                        <div class="col-sm-8">
                            <input name="professionalSkill" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">专业职务级别：</label>
                        <div class="col-sm-8">
                            <select name="professionalLevel" class="form-control m-b" th:with="type=${@dict.getType('old_professional_level')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">月收入总额(元)：</label>
                        <div class="col-sm-8">
                            <input name="incomeAll" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">基本退休费：</label>
                        <div class="col-sm-8">
                            <input name="incomeRetire" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">生活补贴：</label>
                        <div class="col-sm-8">
                            <input name="subsidyLife" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">其他补贴：</label>
                        <div class="col-sm-8">
                            <input name="subsidyOther" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">婚姻状况：</label>
                        <div class="col-sm-8">
                            <select name="maritalStatus" class="form-control m-b" th:with="type=${@dict.getType('old_marital_status')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">配偶姓名：</label>
                        <div class="col-sm-8">
                            <input name="spouseName" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">配偶出生年月：</label>
                        <div class="col-sm-8">
                            <input name="spouseBirth" class="time-input" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">配偶现状：</label>
                        <div class="col-sm-8">
                            <select name="spouseStatus" class="form-control m-b" th:with="type=${@dict.getType('old_spouse_status')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">配偶工作单位及职务：</label>
                        <div class="col-sm-8">
                            <input name="spouseWork" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">配偶联系电话：</label>
                        <div class="col-sm-8">
                            <input name="spousePhone" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">子女总数：</label>
                        <div class="col-sm-8">
                            <input name="childrenNum" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">无劳动能力子女：</label>
                        <div class="col-sm-8">
                            <input name="childrenNowork" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">需赡养人数：</label>
                        <div class="col-sm-8">
                            <input name="supportNum" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">需抚养人数：</label>
                        <div class="col-sm-8">
                            <input name="raiseNum" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">家庭住址邮政编码：</label>
                        <div class="col-sm-8">
                            <input name="postalCode" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">家庭具体住址：</label>
                        <div class="col-sm-8">
                            <input name="address" class="form-control" type="text">
                        </div>
                    </div>
               </div>
            </div>

        <div class="row">
         <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-3 control-label">住宅电话：</label>
                <div class="col-sm-8">
                    <input name="addressTelephone" class="form-control" type="text">
                </div>
            </div>
             </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">建筑面积：</label>
                        <div class="col-sm-8">
                            <input name="addressArea" class="form-control" type="text">
                        </div>
                    </div>
                </div>
        </div>

         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">购房情况：</label>
                    <div class="col-sm-8">
                        <select name="housePurchase" class="form-control m-b" th:with="type=${@dict.getType('old_house_purchase')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">子女1姓名：</label>
                    <div class="col-sm-8">
                        <input name="child1Name" class="form-control" type="text">
                    </div>
                </div>
             </div>
         </div>
         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">子女1现居住地：</label>
                    <div class="col-sm-8">
                        <input name="child1Address" class="form-control" type="text">
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">子女1联系电话：</label>
                    <div class="col-sm-8">
                        <input name="child1Telephone" class="form-control" type="text">
                    </div>
                </div>
             </div>
         </div>

         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">子女2姓名：</label>
                    <div class="col-sm-8">
                        <input name="child2Name" class="form-control" type="text">
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">子女2现居住地：</label>
                    <div class="col-sm-8">
                        <input name="child2Address" class="form-control" type="text">
                    </div>
                </div>
             </div>
         </div>

         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">子女2联系电话：</label>
                    <div class="col-sm-8">
                        <input name="child2Telephone" class="form-control" type="text">
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">其他联系人姓名：</label>
                    <div class="col-sm-8">
                        <input name="otherContactsName" class="form-control" type="text">
                    </div>
                </div>
             </div>
         </div>

         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">其他联系人关系：</label>
                    <div class="col-sm-8">
                        <input name="otherContactsRelationship" class="form-control" type="text">
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">其他联系人居住地：</label>
                    <div class="col-sm-8">
                        <input name="otherContactsAddress" class="form-control" type="text">
                    </div>
                </div>
             </div>
         </div>

         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">其他联系人联系电话：</label>
                    <div class="col-sm-8">
                        <input name="otherContactsTelephone" class="form-control" type="text">
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">评残情况：</label>
                    <div class="col-sm-8">
                        <input name="disabilityStas" class="form-control" type="text">
                    </div>
                </div>
             </div>
         </div>

         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">合同医院名称：</label>
                    <div class="col-sm-8">
                        <input name="assignedHospital" class="form-control" type="text">
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">医疗社会保险：</label>
                    <div class="col-sm-8">
                        <select name="insurance" class="form-control m-b" th:with="type=${@dict.getType('old_insurance')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
             </div>
         </div>

         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">就近医院名称：</label>
                    <div class="col-sm-8">
                        <input name="nearbyHospital" class="form-control" type="text">
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">社会保障号码：</label>
                    <div class="col-sm-8">
                        <input name="socialSecurityNo" class="form-control" type="text">
                    </div>
                </div>
             </div>
         </div>

         <div class="row">
             <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">发挥作用情况：</label>
                    <div class="col-sm-8">
                        <input name="performance" class="form-control" type="text">
                    </div>
                </div>
             </div>
             <div class="col-sm-6">
                 <div class="form-group">
                     <label class="col-sm-3 control-label is-required">归属地区：</label>
                     <div class="col-sm-8">
                         <div class="input-group">
                             <input name="deptId" onclick="selectDeptTree()" id="treeName" type="text" readonly="readonly" placeholder="请选择归属地区" class="form-control" required>
                             <span class="input-group-addon"><i class="fa fa-search"></i></span>
                         </div>
                     </div>
                 </div>
             </div>
         </div>

          <h4 class="form-header h4">其他信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label">备注：</label>
                        <div class="col-xs-10">
                            <textarea name="resume" maxlength="500" class="form-control" rows="3"></textarea>
                        </div>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>

    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "cadre/cadre"
        $("#form-cadre-add").validate({
            phonenumber:{
                isPhone:true,
                remote: {
                    url: prefix + "/checkPhoneUnique",
                    type: "post",
                    dataType: "json",
                    data: {
                        "phonenumber": function () {
                            return $.common.trim($("#phonenumber").val());
                        }
                    },
                    dataFilter: function (data, type) {
                        return $.validate.unique(data);
                    }
                }
            },
            messages: {
                "phonenumber":{
                    remote: "手机号码已经存在"
                }
            },
            focusCleanup: true
        });

        /*用户管理-新增-选择班级树*/
        function selectDeptTree() {
            var treeId = $("#treeId").val();
            var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
            var url = ctx + "system/dept/selectDeptTree/" + deptId;
            var options = {
                title: '选择班级',
                width: "380",
                url: url,
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){
            var tree = layero.find("iframe")[0].contentWindow.$._tree;
            if ($.tree.notAllowParents(tree)) {
                var body = layer.getChildFrame('body', index);
                $("#treeId").val(body.find('#treeId').val());
                $("#treeName").val(body.find('#treeName').val());
                layer.close(index);
            }
        }

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-cadre-add').serialize());
            }
        }

        $("input[name='loginDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>